<?php
namespace catchAdmin\product\model\search;

trait ProductSearch
{
    public function searchGoodsNameAttr($query, $value, $data)
    {
        return $query->whereLike('goods_name', $value);
    }
    public function searchBarcodeAttr($query, $value, $data)
    {
        return $query->where('barcode', $value);
    }
    public function searchGoodsIdAttr($query, $value, $data)
    {
        return $query->where('goods_id', $value);
    }
//sku
    public function searchSerialNumberAttr($query, $value, $data)
    {
        return $query->whereLike('serial_number', $value);
    }

    public function searchSkuAttr($query, $value, $data)
    {
        return $query->whereLike('sku', $value);
    }
    public function searchNewCartonSizeAttr($query, $value, $data)
    {
        return $query->where('new_carton_size', $value);
    }

}
